<%--
  老师端对学生基本信息的增删查改
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        table{
            width: 1200px;
        }
        tr,td{
            border: grey 1px ;
        }
        td{
            height: 40px;
        }

        table td{
            height: 60px;
            vertical-align: middle!important;  /*设置文字垂直居中*/
            text-align: center;
        }

        tr,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}

        th{font-weight:bold;background:#ccc;}

        .con-b .row .lf{
            width: 15%;
            text-align: center;
            padding: 10px;
        }
        .con-b .row .rg{
            width: 85%;
        }

        .con-b tr:nth-of-type(odd){
            background-color: #f2f2f2;
        }

    </style>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
</head>
<body>
<table border="1" cellspacing="0" align="center" class="con-b">
    <thead>
    <tr class="row" style="color: black;font-size: 25px" >
        <td class="lf">账号</td>
        <td class="lf">姓名</td>
        <td class="lf">性别</td>
        <td class="lf">学号</td>
        <td class="lf">身份</td>
        <td class="lf">邮箱</td>
        <td class="lf">修改</td>
        <td class="lf">删除</td>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${arr}" var="person">
    <tr>

        <td class="lf">${person.getUserAccount()}</td>
        <td class="lf">${person.getUserName()}</td>
        <td class="lf">${person.getUserSex()}</td>
        <td class="lf">${person.getUserId()}</td>
        <td class="lf">
            <c:if test="${person.getUserIdentify()==0}">
                普通学生
            </c:if>
        </td>
        <td class="lf">${person.getUserEmail()}</td>
        <td> <img src="fix.png" onclick="fixThisStu('${person.getUserId()}')" style="left: 30px"></td>
        <td> <img src="delete.png" onclick="delThisStu('${person.getUserId()}')" style="left: 30px"></td>

    </tr>

    </c:forEach>
    <tr>
        <td style="width: 100px" onclick="addStudent()">添加</td>
        <td><img src="insert.png" onclick="addStudent()"></td>
    </tr>
    </tbody>


</table>

</body>

<script>
    function delThisStu(userId){
        window.location.href="tea.action?action=delThisStu&userId="+userId;
        alert("删除成功");
    }

    function fixThisStu(userId) {
        window.location.href="tea.action?action=fixThisStu&userId="+userId;
        alert("修改成功");
    }

    function addStudent(){

        window.location.href="tea.action?action=addStudent";
    }

</script>


</html>

